package spring_annotation.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import spring_annotation.dao.StudentDao;

@Service
public class StudentService {

    @Autowired
    private StudentDao studentDao;

    @Transactional
    public void insertStudent(){
        studentDao.insert();
        System.out.println("插入完成。。。");
    }

    @Transactional
    public void insertClass(){
        studentDao.insertClass();
        System.out.println("插入完成。。。");
    }

    @Transactional
    public void updateStudent(int i){
        studentDao.updateStudent(i);
        System.out.println("更新完成。。。");
    }
}
